/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.platformservice.theme.panel;

import org.proteusframework.platformservice.events.IEventProducer;

import static org.proteusframework.platformservice.IExtendedRuntimeConfiguration.KEY_THEME_SERVICE;

public interface IDialog extends IRenderedComponent, IEventProducer<DialogEvent>
{
    public static final String DIALOG_NS = KEY_THEME_SERVICE + RENDERED_NS + ".Dialog.";

    /**
     * Key used to provide a suggested title for the dialog.
     */
    public static final String KEY_TITLE = "Title";

    /**
     * Key used to suggest that the dialog should be model.
     */
    public static final String KEY_MODAL = "Modal";

    /**
     * Key used to suggest a minimum dialog width.
     */
    public static final String KEY_MIN_WIDTH = "MinWidth";

    /**
     * Key used to suggest a minimum dialog height.
     */
    public static final String KEY_MIN_HEIGHT = "MinHeight";

    /**
     * Key used to suggest a button set for the dialog.
     */
    public static final String KEY_BUTTONS = "Buttons";

    /**
     * Suggests the dialog be built with OK and Cancel buttons.
     */
    public static final String BUTTONS_OK_CANCEL = "OkCancel";

    /**
     * Suggests the dialog be built with only a Cancel button.
     */
    public static final String BUTTONS_OK = "Ok";

    /**
     * Suggests the dialog be built with no buttons; the assumption is either the component provides its own buttons,
     * or the dialog automatically closes once an event gate is crossed.
     */
    public static final String BUTTONS_NONE = "None";

    /**
     * Sets a metadata property in this definition.
     *
     * @param key   Property key
     * @param value Property value
     * @return IDialog, so that setProperty calls can be chained together
     */
    IDialog setProperty(String key, String value);
}
